package com.shucoin.www.tycoin.adapter;

import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shucoin.www.tycoin.R;
import com.shucoin.www.tycoin.bean.BidsBean;

import java.util.List;

/**
 * Created by happy on 2017/8/26.
 */

public class DepthAdapter extends BaseQuickAdapter<BidsBean, BaseViewHolder> {
    public DepthAdapter(List<BidsBean> list) {
        super(R.layout.item_depth, list);
    }



    @Override
    protected void convert(BaseViewHolder helper, BidsBean item) {
        helper.setText(R.id.item_depth_des,"卖"+(helper.getLayoutPosition()+1));
        TextView textPrice=helper.getView(R.id.item_depth_price);
        TextView textdes= helper.getView(R.id.item_depth_des);
        if (item.getType()==1){
            helper.setText(R.id.item_depth_des,"买"+(5-helper.getLayoutPosition()));
            textdes.setTextColor(textdes.getContext().getResources().getColor(R.color.green));
            textPrice.setTextColor(textdes.getContext().getResources().getColor(R.color.green));
        }

        helper.setText(R.id.item_depth_price,item.getPrice());
        helper.setText(R.id.item_depth_count,item.getCount());
    }
}
